package test_achieve.web.scenes;
import constant.Pm;
import cucumber.api.java.en.Given;
import test_achieve.web.Oneself;
import test_achieve.web.OrderMain;


/**
 * Created by chenkuo on 2017/10/23.
 */
public class OneToMany {

    /**一取多投的场景封装*/


    /**前置：无
     * 步骤：登录，切成城市，一取多投详情输入，下单*/

    @Given("^w用户下了一个一取多投单"+ Pm.p12)
    public void w用户下了一个一取多投单(String username,String city,String addressTwo,String sendAdress,String sendName,String sendMobile,String receiveAddress,String receiveName,String receiveMobile,String weights,String goodsName,String remark) throws Throwable {
        Basic basic = new Basic();
        basic.w登录并切换城市( username, city);
        Oneself me = new Oneself();
        me.w进入在线下单界面();
        OrderMain webmain = new OrderMain();
        webmain.w选择添加一个收件地址();
        webmain.w输入新添收件地址与收件人信息收件人地址(addressTwo);
        basic.w输入寄件人信息与收件人信息( sendAdress, sendName, sendMobile, receiveAddress, receiveName, receiveMobile);
        basic.w输入物品信息( weights, goodsName, remark);
        webmain.wClickNext();
        webmain. wSubmitOrder();
        webmain.w确认订单提交成功();

    }

    @Given("^w用户下了一个一取多投单"+Pm.p6)
    public void w用户下了一个一取多投单(String username,String sendAdress,String addressTwo,String receiveAddress,String weights,String goodsName) throws Throwable {
        w用户下了一个一取多投单( username, null, addressTwo, sendAdress, null, null, receiveAddress, null, null, weights, goodsName, null);

    }

    @Given("^w用户下了一个一取多投单"+Pm.p4)
    public void w用户下了一个一取多投单(String username,String sendAdress,String addressTwo,String receiveAddress) throws Throwable {
        w用户下了一个一取多投单( username, null, addressTwo, sendAdress, null, null, receiveAddress, null, null, null, null, null);

    }


}
